/*	
	Finally a jQuery Watermark plugin that works
	Version: 1.0.0
	http://github.com/fabrikagency/fa-watermark

	Copyright (c) 2010 Caleb Wright, Fabrik Agency
	http://fabrikagency.com/
------------------------------------------------------*/
(function($) { 
  $.fn.watermark = function (defaultValue, className) {
    className = className || 'watermark';
    return this.each(function () {
      var input = $(this);
      if (input.val() == "") {
        input.val(defaultValue);
        input.addClass(className);
      }
      input.focus(function () {
        if (input.val() == defaultValue) {
          input.val('');
        }
        input.removeClass(className);
      }).blur(function () {
        if (input.val() == "") {
          input.val(defaultValue);
        }
        input.addClass(className);
      });
      input.closest('form').submit(function () {
        if (input.val() == defaultValue) {
          input.val('');
        }
      });
    });
  };
})(jQuery);